.PHONY: all clean
.SUFFIXES: .java .class

#list of source files to compile
SOURCES=AtomicChannel.java CausalAtomicChannel.java ChatClient.java ChatClientRecord.java ChatMessage.java IterativeChatServer.java
JARS=zookeeper-3.3.3/zookeeper-3.3.3.jar:zookeeper-3.3.3/build/recipes/lock/zookeeper-3.3.3-recipes-lock.jar:zookeeper-3.3.3/lib/log4j-1.2.15.jar 
FLAGS=-Xlint:unchecked

all: $(SOURCES:.java=.class)

#rule to convert .java files to .class files
.java.class:
	javac $*.java -cp .:$(JARS) $(FLAGS)

clean:
	rm -rf *.class

